﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEditor;
using Memo.Electricity.Engine;
using Memo.Electricity.Game;

namespace Memo.Electricity.Editor
{
	[CustomEditor(typeof(CGravel))]
	public class GravelEditor : UnityEditor.Editor
	{
		private void OnSceneGUI()
		{
			var go = (target as CGravel).gameObject;
			if (go.transform.childCount == 0)
			{
				var e = go.GetComponent<Explodable>();
				e.fragmentInEditor();
				EditorUtility.SetDirty(e);
			}

		}
	}
}